# -*- coding: utf-8 -*- 
# @Time : 2023/11/22 14:25 
# @Author : YangGuangjian
# @File : api_client.py

from urllib.parse import urljoin
import requests

class APIClient:
    def __init__(self):
        self.session = requests.Session()

    def send_request(self, method, host, uri, **kwargs):
        url = urljoin(host,uri)
        response = self.session.request(method, url, **kwargs)
        return response


if __name__ == '__main__':
    client = APIClient()
    res = client.send_request(
        method="post",
        host="http://httpbin.org",
        uri="/post",
        params="aa=11&bb=22",
        data={"a": 1},
    )
    print(res.text)